using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BlawkayMobileLibrary
{
    public class Button
    {
        public Button(string oText, Vector2 vPosition, float fRadius, Texture2D oTexture)
        {
            Message = oText;
            Position = vPosition;
            Radius = fRadius;

            Origin = new Vector2(oTexture.Width, oTexture.Height);
            Origin *= 0.5f;
            float fScale = (fRadius * 2) / oTexture.Width;
            Scale = new Vector2(fScale);
        }

        public void Draw(SpriteBatch oSpriteBatch, Texture2D oTexture, SpriteFont oFont)
        {
            oSpriteBatch.Draw(
                oTexture,
                Position, null,
                Color.Red,
                0.0f,
                Origin,
                Scale,
                SpriteEffects.None,
                0.5f);

            oSpriteBatch.DrawString(
                oFont,
                Message,
                Position,
                Color.Black,
                0.0f,
                Vector2.Zero,
                0.75f,
                SpriteEffects.None,
                1.0f);
        }

        public string Message;

        public Vector2 Position;
        public float Radius;

        public Vector2 Origin;
        public Vector2 Scale;

    }
}
